As an individualized demand of a user for a smartphone increases, a user behavior recognition function has become a basic configuration of the smartphone. The user behavior recognition function means that a behavior of a user can be determined at a specific time, at a specific place, or on a specific occasion, to enable the smartphone to predict a requirement of the user based on the determined behavior of the user, automatically adjust various settings, and provide a related service for the user. A user behavior may refer to an activity status of the user, such as, walking, running, staying still, climbing stairs, walking down stairs, or sleeping, or refer to a scenario that the user is in, such as, in an office, in a car, on a train, outdoors, indoors, in a conference, or in a theater, or a combination of an activity status of the user and a scenario that the user is in, that is, staying still in a car, staying still in a conference, or the like.
User behavior recognition is based on a behavior recognition model. A smartphone may create one behavior recognition model for each user behavior. When collecting a group of sensing data, the smartphone may input the sensing data to the foregoing created behavior recognition model, and determine, according to an output result of the behavior recognition model, a behavior corresponding to the sensing data. A common method for creating a behavior recognition model is a machine learning method. In this method, generally, a large amount of training data is required to create an accurate behavior recognition model. However, in reality, there is usually little available training data, and accuracy of behavior recognition performed by a behavior recognition model created in this case is relatively poor. After obtaining an initial behavior recognition model, each user needs to accumulate training data of the user, and update a behavior recognition model of the user according to the accumulated training data, to improve accuracy of behavior recognition performed by the behavior recognition model.
Therefore, in the prior art, different users are separated from each other, and each user needs to independently create a new behavior recognition model, independently accumulate training data, and update the new behavior recognition model according to the accumulated training data. This process is usually time-consuming and strenuous. Therefore, scalability of the prior art for a new user behavior is relatively poor, accuracy of a new behavior recognition model created by a user is relatively low, relatively long time of learning is required to meet an accuracy requirement of the user for behavior recognition, and user experience is relatively poor.